#!/bin/bash

###############Register a face################
case1_expect="user name: fbb, state: registered."
check_results_case1=`./register.sh fbbreg.jpg fbb`
if [[ $check_results_case1 == *$case1_expect* ]] 
then 
    echo "Register a face success "
else 
    echo "Register a face fail"
 fi


###############One face input ################

case2_expect="please make sure there is only one face in the picture."
check_results_case2=`./register.sh twoperson.jpg two`
if [[ $check_results_case2 == *$case2_expect* ]] 
then 
    echo "One face input success "
else 
    echo "One face input fail"
 fi

###############Detect one face ################

case3_expect="matched! name: fbb - register date"
check_results_case3=`./run.sh fbbreco.jpg`
if [[ $check_results_case3 == *$case3_expect* ]] 
then 
    echo "Detect one face success "
else 
    echo "Detect one face fail"
 fi

###############Get face frame and calculate face features################

case4_expect="feature_map:"
check_results_case4=`./run.sh fbbreco.jpg`
if [[ $check_results_case4 == *$case4_expect* ]] 
then 
    echo "Get face frame and calculate face features success "
else 
    echo "Get face frame and calculate face features fail"
 fi

###############Face recognition################

case5_expect="face recognition result: not matched."
check_results_case5=` ./run.sh ldhreg.jpg`
if [[ $check_results_case5 == *$case5_expect* ]] 
then 
    echo "Face recognition success "
else 
    echo "Face recognition fail"
 fi

###############Delete registered faces################

case6_expect="user name: fbb clear done."
check_results_case6=`./clear.sh fbb`
if [[ $check_results_case6 == *$case6_expect* ]] 
then 
    echo "Delete registered faces success "
else 
    echo "Delete registered faces fail"
 fi


###############Clear database################


case7_expect="database(table) clear done."
check_results_case7=`./clear.sh`
if [[ $check_results_case7 == *$case7_expect* ]] 
then 
    echo "Clear database success "
else 
    echo "Clear database fail"
 fi

